<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{#用户头像#}
{% if user.user_img %}
<a><img src="{{  user.user_img }}" style="max-width:100px;max-height:100px"></a><br>
<form action="/insertProductData/"  method="post" enctype="multipart/form-data">
{% csrf_token %}
        <input type="file" name="image">
<button type="submit">更换头像</button>
</form>
{% else %}
    <form action="/insertProductData/"  method="post" enctype="multipart/form-data">
{% csrf_token %}
        <input type="file" name="image">
<button type="submit">添加头像</button>
    </form>
{% endif %}

</body>
</html>